{extend name="base" /} {block name="body"}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="">
				<a href="{:url('member/index')}">会员管理</a>
			</li>
			<li class="layui-this">添加会员</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
				<form class="layui-form form-container" action="{:url('member/add')}" method="post">
					<div class="layui-form-item">
						<label class="layui-form-label">账号(手机号)</label>
						<div class="layui-input-block">
							<input type="text" name="mobile"  placeholder="请输入手机号"  class="layui-input">
						</div>
					</div>
					
					<div class="layui-form-item">
						<label class="layui-form-label">登录密码</label>
						<div class="layui-input-block">
							<input type="password" name="password"  placeholder="请输入登录密码" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">姓名</label>
						<div class="layui-input-block">
							<input type="text" name="name" placeholder="请输入姓名" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">性别</label>
						<div class="layui-input-block">
							<select name='sex'>
							<option name='sex' value='1'>男</option>
							<option name='sex' value='0'>女</option>
							</select>
						</div>
					</div>
					
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="hidden" name="user_id" >
							<button  onclick='add()'class="layui-btn" lay-submit lay-filter="*">确定</button>
						
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script>
	function add(index){
			$.ajax({
				type:"post",
				url: "{:url('member/add')}",
				
				success: function(data) {
						if(data.status == 1) {
							layer.msg('添加成功', {
								icon: 1,
								time: 3000,
							});
						} else {
							layer.msg(data.msg, {
								icon: 6,
								time: 1500,
								shade: 0.1
							});
							return false;
						}
						location.reload();
					}
			});
		
	}
	
</script>
{/block}